package gitapp.oschina.net.my_osc.api;

import com.kymjs.rxvolley.client.HttpCallback;
import com.kymjs.rxvolley.client.HttpParams;

/**
 * Created by houjianhua on 2016/10/25.
 */

public class GitOSCApi {
    public final static String HOST = "git.oschina.net/";
    private static final String API_VERSION = "api/v3/";// API版本
    public final static String HTTP = "http://";
    public final static String BASE_URL = HTTP + HOST + API_VERSION;
    public final static String NO_API_BASE_URL = HTTP + HOST;
    public final static String PROJECTS = BASE_URL + "projects/";
    public final static String USER = BASE_URL + "user/";
    public final static String EVENT = BASE_URL + "events/";
    public final static String NOTIFICATION = USER + "notifications/";
    public final static String VERSION = BASE_URL + "app_version/new/android";

    public static void getNotification(String filter, String all, String projectId, HttpCallback
                                       handler){
        HttpParams params = AsyncHttpHelp.getPrivateTokenWithParams();
        params.put("filter", filter);
        params.put("all", all);
        AsyncHttpHelp.get(NOTIFICATION, params, handler);
    }

    public static void getUpdateInfo(HttpCallback handler){
        AsyncHttpHelp.get(VERSION, handler);
    }

}
